#!/usr/bin/env python
# -*- coding: utf-8 -*-

# @Time     :2020/08/03
# @Author   :Changshu
# @File     :practice_20.py
# 20. 有效的括号

def isValid(s:str)->bool:
	while '()' in s or '{}' in s or '[]' in s:
		s = s.replace('()', '')
		s = s.replace('{}', '')
		s = s.replace('[]', '')
	return s==''

if __name__=='__main__':
	print(isValid('{[]}'))

